<template>
  <div>
    <div class="container1">
      <div class="common-title-flex">
        <div class="common-title-div"></div>
        <div class="common-title-text">岗位查询条件</div>
      </div>
      <el-form ref="searchObj" :inline="true" :model="searchObj" size="mini" label-width="100px" style="margin-bottom: -10px; margin-top: 10px">
        <el-form-item label="岗位名称">
          <el-input v-model="searchObj.stationName" placeholder="请输入岗位名称" clearable></el-input>
        </el-form-item>
        <el-form-item label="经验要求">
          <el-select v-model="searchObj.experience" placeholder="请选择">
            <el-option v-for="item in experienceOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="最低学历要求">
          <el-select v-model="searchObj.minEducation" placeholder="请选择">
            <el-option v-for="item in educationOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item style="margin-left: 2rem">
          <el-button type="primary" icon="el-icon-search" @click="query">查询</el-button>
          <el-button @click="reset" icon="el-icon-refresh">重置</el-button>
        </el-form-item>
      </el-form>
    </div>

    <div class="container" style="margin-top: 1rem">
      <div class="common-list-class">
        <div style="display: flex">
          <div class="common-title-div"></div>
          <div class="common-title-text">岗位查询列表</div>
        </div>
        <div style="display: flex">
          <el-button type="primary" v-if="typeCode == 'business'" style="height: 32px" icon="el-icon-circle-plus-outline" @click="addPolice">创建岗位</el-button>
        </div>
      </div>
      <!-- 查询列表 -->
      <el-table :data="tableData" size="mini" :row-style="rowStyle" :header-cell-style="tableHeaderColor" style="width: 100%; margin-top: 10px; margin-bottom: 10px" max-height="550" border>
        <el-table-column prop="stationName" label="岗位名称" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="jobStatusDesc" label="是否急招" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationDesc" label="岗位描述" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="experienceDesc" label="经验要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="minEducationDesc" label="最低学历要求" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="salaryRange" label="薪资范围(元)" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="stationTags" label="岗位标签" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column prop="resumeNum" label="投递简历数量" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="300" align="center">
          <template slot-scope="scope">
            <el-button type="primary" size="mini" icon="el-icon-search" @click="seeClick(scope.row)">查看</el-button>
            <el-button type="primary" size="mini" icon="el-icon-edit" @click="detailsClick(scope.row)">编辑</el-button>
            <!-- <el-button
              type="danger"
              size="mini"
              icon="el-icon-circle-close"
              @click="progressClick(scope.row)"
              >删除</el-button -->
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <el-row type="flex" justify="end">
        <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizes" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
      </el-row>
    </div>
    <!-- 创建岗位 -->
    <el-dialog :title="isEditTitle" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="newaddFlag" width="45%" :before-close="newaddcancel" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">{{ isEditTitle }}</div>
      </div>
      <el-form ref="inputObj" :model="inputObj" label-width="140px" :rules="rules">
        <el-form-item label="岗位名称" class="required-content-red">
          <el-input @input="onInput()" v-model="inputObj.stationName" placeholder="请输入岗位名称" clearable></el-input>
        </el-form-item>
        <el-form-item label="薪资范围(元)" class="required-content-red">
          <el-col :span="8">
            <el-input-number @input="onInput()" v-model="startnum" controls-position="right" @change="handlestartChange" :min="1"></el-input-number>
          </el-col>
          <el-col :span="2" style="margin-left: 3px">-</el-col>
          <el-col :span="8">
            <el-input-number @input="onInput()" v-model="endnum" controls-position="right" @change="handleendChange" :min="1"></el-input-number>
          </el-col>
        </el-form-item>
        <el-form-item label="经验要求" class="required-content-red">
          <el-select v-model="inputObj.experience" placeholder="请选择经验要求" style="width: 100%" @change="OnChange()">
            <el-option v-for="item in experienceList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="学历要求" class="required-content-red">
          <el-select v-model="inputObj.minEducation" placeholder="请选择学历要求" style="width: 100%" @change="OnChange()">
            <el-option v-for="item in educationList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="岗位标签" class="required-content-red">
          <el-select v-model="inputObj.posttag" multiple collapse-tags placeholder="请选择岗位标签" style="width: 100%" @change="OnChange()">
            <el-option v-for="item in posttagList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
            <el-button class="button-new-tag" size="mini" type="primary" @click="showInput">新增标签</el-button>
          </el-select>
        </el-form-item>
        <el-form-item label="是否急招" class="required-content-red">
          <el-select v-model="inputObj.jobStatus" placeholder="请选择是否急招" style="width: 100%" @change="OnChange()">
            <el-option v-for="item in urgentList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="岗位描述" class="required-content-red">
          <el-input v-model="inputObj.stationDesc" @input="onInput()" placeholder="请输入岗位描述" clearable></el-input>
        </el-form-item>
        <el-form-item label="岗位投递时间" class="required-content-red">
          <div style="display:flex;">
            <div>
              <el-date-picker @change="OnChange()" @blur="dateChange" :disabled="unlimitedFlag" v-model="inputObj.createTime" unlink-panels type="daterange" value-format="yyyyMMdd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </div>
            <div style="margin-left:30px;">
              <el-checkbox v-model="unlimitedFlag" @change="unlimitedFlagChange">不限</el-checkbox>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="岗位负责人名称" class="required-content-red">
          <el-input v-model="inputObj.managerName" @input="onInput()" placeholder="请输入岗位负责人名称" clearable></el-input>
        </el-form-item>
        <el-form-item label="岗位咨询服务电话" class="required-content-red">
          <el-input v-model="inputObj.managerPhone" @input="onInput()" placeholder="请输入岗位咨询服务电话" clearable></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit">确 定</el-button>
        <el-button @click="newaddcancel">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title="新增标签" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="tagFlag" width="40%" :before-close="closeTag" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">新增标签</div>
      </div>
      <el-form ref="tagObj" :model="tagObj" label-width="130px">
        <el-form-item label="标签名称">
          <el-input @input="onInput()" v-model="tagObj.name" placeholder="请输入标签名称" clearable></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" type="primary" @click="submitTag">提 交</el-button>
        <el-button size="mini" @click="closeTag">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 警员详情 -->
    <el-dialog title="详情" :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="detailsFlag" width="40%" :before-close="detailsClose" center>
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">详情</div>
      </div>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">岗位名称</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsObj.stationName }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">是否急招</el-col>
        <el-col :span="15" class="grey-class">{{ detailsObj.jobStatusDesc }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">经验要求</el-col>
        <el-col :span="15" class="grey-class">{{ detailsObj.experienceDesc }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">学历要求</el-col>
        <el-col :span="15" class="grey-class">{{
          detailsObj.minEducationDesc
        }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">薪资范围(元)</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsObj.salaryRange }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">岗位标签</el-col>
        <el-col :span="15" class="grey-class" style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap">{{ detailsObj.stationTags }}</el-col>
      </el-row>
      <el-row type="flex" justify="center">
        <el-col :span="4" class="bold-class">投递简历数量</el-col>
        <el-col :span="15" class="grey-class">{{ detailsObj.resumeNum }}</el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="detailsClose">关 闭</el-button>
      </span>
    </el-dialog>
    <!--  -->
    <!-- 投递岗位 -->
    <el-dialog title="投递岗位" :visible.sync="deliveryPost" center width="50%">
      <div slot="title" class="header-title">
        <div class="header-title-div"></div>
        <div class="header-title-text">投递岗位</div>
      </div>
      <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="岗位名称" width="120">
          <template slot-scope="scope">{{ scope.row.date }}</template>
        </el-table-column>
        <el-table-column prop="name" label="薪资水平" width="120">
        </el-table-column>
        <el-table-column prop="address" label="岗位介绍" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="岗位标签" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="经验要求" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="address" label="最低学历要求" show-overflow-tooltip>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="addconfirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import mixin from "@/mixin/mixin.js";
export default {
  name: "meeting",
  mixins: [mixin],
  data() {
    return {
      deliveryPost: false,
      unlimitedFlag: false,
      tagObj: {},
      tagFlag: false,
      urgentList: [
        {
          value: "0",
          label: "否",
        },
        {
          value: "1",
          label: "是",
        },
      ],
      posttagList: [
        {
          value: "交通补助",
          label: "交通补助",
        },
        {
          value: "五险一金",
          label: "五险一金",
        },
        {
          value: "加班补贴",
          label: "加班补贴",
        },
        {
          value: "话费补助",
          label: "话费补助",
        },
      ],
      educationList: [
        {
          value: "0",
          label: "不限",
        },
        {
          value: "1",
          label: "应届生",
        },
        {
          value: "2",
          label: "本科",
        },
        {
          value: "3",
          label: "研究生",
        },
        {
          value: "4",
          label: "博士",
        },
        {
          value: "5",
          label: "大专",
        },
        {
          value: "6",
          label: "高中",
        },
        {
          value: "7",
          label: "初中",
        },
      ],
      educationOptions: [
        {
          value: "0",
          label: "不限",
        },
        {
          value: "1",
          label: "应届生",
        },
        {
          value: "2",
          label: "本科",
        },
        {
          value: "3",
          label: "研究生",
        },
        {
          value: "4",
          label: "博士",
        },
        {
          value: "5",
          label: "大专",
        },
        {
          value: "6",
          label: "高中",
        },
        {
          value: "7",
          label: "初中",
        },
      ],
      experienceOptions: [
        {
          value: "0",
          label: "不限",
        },
        {
          value: "1",
          label: "1年",
        },
        {
          value: "2",
          label: "2年",
        },
        {
          value: "3",
          label: "1-3年",
        },
        {
          value: "4",
          label: "3-5年",
        },
        {
          value: "5",
          label: "5-10年",
        },
        {
          value: "6",
          label: "十年以上",
        },
      ],
      experienceList: [
        {
          value: "0",
          label: "不限",
        },
        {
          value: "1",
          label: "1年",
        },
        {
          value: "2",
          label: "2年",
        },
        {
          value: "3",
          label: "1-3年",
        },
        {
          value: "4",
          label: "3-5年",
        },
        {
          value: "5",
          label: "5-10年",
        },
        {
          value: "6",
          label: "十年以上",
        },
      ],
      startnum: 1,
      endnum: 1000,
      dynamicTags: ["五险一金", "话费补助", "加班补助"],
      inputVisible: false,
      inputValue: "",
      isPerson: false,
      newFlag: false,
      deliveryPost: false,
      createTime: [],
      progressFlag: false,
      uploadHeader: {},

      uploadUrl: "https://jsonplaceholder.typicode.com/posts/",
      rules: {
        remark: [
          { required: true, message: "请输入反馈内容", trigger: "blur" },
        ],
      },
      //经验要求
      options: [
        {
          value: "选项1",
          label: "没有要求",
        },
        {
          value: "选项2",
          label: "1年以内",
        },
        {
          value: "选项3",
          label: "1-3年",
        },
        {
          value: "选项4",
          label: "3-5年",
        },
      ],
      value: "",
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      multipleSelection: [],
      detailsObj: {
        companyName: "江苏省南京市有限公司",
        industyType: "IT行业",
        relationMan: "张三",
        positionPost: "负责人",
        relationPhone: "139282930303",
        companyStation: "南京市新港区29号",
        companyPhone: "025-12321321321",
      },
      inputObj: {
        companyName: "",
        industyType: "",
        relationMan: "",
        positionPost: "",
        relationPhone: "",
        companyStation: "",
        companyPhone: "",
        posttag: [],
      },
      detailsFlag: false,
      isEditTitle: "新建岗位",
      newaddFlag: false,
      findFlag: false,
      newfindFlag: false,
      pageSizes: [10, 15, 50, 100],
      pagesize: 10,
      total: 10,
      currentPage: 1,
      tableData: [
        {
          id: "1",
        },
      ],
      tableData: [
        {
          enterPrise: "",
          deliverTime: "",
          postNumber: "",
          audit: "",
          isfindTitle: "",
        },
      ],
      currentgwId: "",
      searchObj: {},
    };
  },
  created() {
    this.query();
  },
  methods: {
    dateChange(value) {
      this.$forceUpdate();
    },
    detailsClick(row) {
      let self = this;
      console.log(row);
      this.currentgwId = row.id;
      this.isEditTitle = "编辑岗位";
      this.startnum = row.beginSalary;
      this.endnum = row.endSalary;
      this.inputObj.stationName = row.stationName;
      this.inputObj.experience = row.experience;
      this.inputObj.minEducation = row.minEducation;
      let list = row.stationTags.split(",");
      list.forEach((item) => {
        if (!self.posttagList.map((val) => val["value"]).includes(item)) {
          self.posttagList.push({
            value: item,
            label: item,
          });
        }
      });
      this.inputObj.posttag = list;
      this.inputObj.jobStatus = String(row.jobStatus);
      this.inputObj.stationDesc = row.stationDesc;
      this.unlimitedFlag = row.stationStatus == "0" ? true : false;
      if (row.effectBegin && row.effectBegin.length) {
        this.inputObj.createTime = [row.effectBegin, row.effectEnd];
      } else {
        this.inputObj.createTime = [];
      }
      this.inputObj.managerPhone = row.managerPhone;
      this.inputObj.managerName = row.managerName;
      this.newaddFlag = true;
    },
    addconfirm() {},
    unlimitedFlagChange(value) {
      if (value) {
        this.inputObj.createTime = [];
      }
    },
    OnChange() {
      this.$forceUpdate();
    },
    onInput() {
      this.$forceUpdate();
    },
    handlestartChange(value) {
      console.log("value----qixin", value);
      if (value > this.endnum) {
        this.$message.error("最低薪资不得超过于最高薪资！");
      }
    },
    handleendChange(value) {
      console.log("value----zhixin", value);
      if (value < this.startnum) {
        this.$message.error("最高不得低于于最低薪资！");
      }
    },
    submitTag() {
      let self = this;
      if (self.posttagList && self.posttagList.length < 8) {
        self.tagFlag = false;
        self.posttagList.push({
          value: self.tagObj.name,
          label: self.tagObj.name,
        });
        self.inputObj.posttag.push(self.tagObj.name);
      } else {
        self.$message.error("最多只能有8个标签！");
      }
    },
    closeTag() {
      this.tagFlag = false;
      this.tagObj.name = "";
    },
    showInput() {
      if (this.posttagList && this.posttagList.length < 8) {
        this.tagFlag = true;
        this.tagObj.name = "";
      } else {
        this.$message.error("最多8个标签！");
      }
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      }
      this.inputVisible = false;
      this.inputValue = "";
    },
    //
    tableHeaderColor({ row, column, rowIndex, columnIndex }) {
      return "background-color:#f5f5f5;color:#626262;";
    },
    rowStyle({ row, rowIndex }) {
      let style1 = {};
      let style2 = {};
      if (rowIndex % 2 == 0) {
        style1.background = "#ffffff";
        return style1;
      } else {
        style2.background = "#f5f5f5";
        return style2;
      }
    },
    allExportClick() {},
    query() {
      let params = {
        stationName: this.searchObj.stationName,
        experience: this.searchObj.experience,
        minEducation: this.searchObj.minEducation,
        pageNumber: this.currentPage,
        pageSize: this.pagesize,
      };
      this.showLoading();
      this.$axios({
        method: "post",
        url: `/hire/queryJobStations`,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.tableData = res.data.data.list;
            this.pagesize = res.data.data.pageSize;
            this.total = res.data.data.total;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    beforeUpload(file) {
      this.showLoading("导入中");
    },
    uploadProgress(event, file, fileList) {
      this.videoUploadPercent = file.percentage.toFixed(0) + "%";
      console.log("event--------", event);
      console.log("file--------", file);
      console.log("fileList--------", fileList);
    },
    uploadSucess(response) {
      this.$message({
        message: "导入成功！",
        type: "success",
      });
      this.hideLoading();
      console.log("response------", response);
    },
    uploadError(error) {
      this.$message({
        message: "导入失败！",
        type: "error",
      });
      this.hideLoading();
      console.log("error-----", error);
    },
    // 新建确认和修改确认
    submit() {
      let self = this;
      let url = "";
      if (!self.inputObj.stationName) {
        this.$message.error("请填写岗位名称");
        return;
      }
      if (!self.startnum) {
        this.$message.error("请选择薪资范围");
        return;
      }
      if (!self.endnum) {
        this.$message.error("请选择薪资范围");
        return;
      }
      if (!self.inputObj.experience) {
        this.$message.error("请选择经验要求");
        return;
      }
      if (!self.inputObj.minEducation) {
        this.$message.error("请选择学历要求");
        return;
      }
      if (!self.inputObj.posttag.length) {
        this.$message.error("请选择岗位标签");
        return;
      }
      if (!self.inputObj.jobStatus) {
        this.$message.error("请选择是否急招");
        return;
      }
      if (!self.inputObj.stationDesc) {
        this.$message.error("请选择输入岗位描述");
        return;
      }
      if (!self.inputObj.createTime) {
        this.$message.error("请选择岗位投递时间");
        return;
      }
      if (!self.inputObj.managerName) {
        this.$message.error("请输入岗位负责人名称");
        return;
      }
      if (!self.inputObj.managerPhone) {
        this.$message.error("请输入岗位咨询服务电话");
        return;
      }
      let params = {
        stationName: self.inputObj.stationName,
        beginSalary: self.startnum,
        endSalary: self.endnum,
        experience: self.inputObj.experience,
        minEducation: self.inputObj.minEducation,
        stationTagList: self.inputObj.posttag,
        jobStatus: self.inputObj.jobStatus,
        stationDesc: self.inputObj.stationDesc,
        stationStatus: self.unlimitedFlag ? "0" : "1",
        effectBegin: self.inputObj.createTime
          ? self.inputObj.createTime[0]
          : "",
        effectEnd: self.inputObj.createTime ? self.inputObj.createTime[1] : "",
        managerName: self.inputObj.managerName,
        managerPhone: self.inputObj.managerPhone,
        stationTagList: self.inputObj.posttag,
      };
      if (self.isEditTitle == "新建岗位") {
        url = "/hire/bindJobStation";
      } else {
        url = "/hire/editJobStation";
        params.id = self.currentgwId;
      }

      console.log(params);
      this.showLoading();
      this.$axios({
        method: "post",
        url: url,
        headers: {
          Authorization: this.requestToken,
        },
        data: params,
      })
        .then((res) => {
          this.hideLoading();
          console.log("res---->:", res);
          if (res.data.code == "20000") {
            this.newaddFlag = false;
            this.inputObj = {};
            this.unlimitedFlag = false;
            this.startnum = 1;
            this.endnum = 1000;
            this.$message({
              message:
                self.isEditTitle == "新建岗位"
                  ? "新增岗位成功！"
                  : "修改岗位成功！",
              type: "success",
            });
            this.query();
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    newaddcancel() {
      this.newaddFlag = false;
      this.inputObj = {};
      this.startnum = 1;
      this.endnum = 1;
    },
    // 取消点击
    cancel() {
      this.newaddFlag = false;
      this.$refs["inputObj"].resetFields();
      this.inputObj = {};
    },
    // 点击分页当前页多少数据
    handleSizeChange(val) {
      this.pagesize = val;
      this.query();
    },
    // 点击分页页数
    handleCurrentChange(val) {
      this.currentPage = val;
      this.query();
    },
    //  重置
    reset() {
      this.searchObj = {};
      this.query();
    },
    progressClose() {
      this.progressFlag = false;
    },
    addPolice() {
      this.newaddFlag = true;
      this.isEditTitle = "新建岗位";
      this.startnum = 1;
      this.endnum = 1000;
    },
    progressClick(row) {
      this.showLoading();
      this.$axios({
        method: "get",
        url: `/labourMicro/queryMicroInfoByProcessCode/${row.labourProcessCode}`,
        headers: {
          Authorization: this.requestToken,
        },
      })
        .then((res) => {
          this.hideLoading();
          if (res.data.code == "20000") {
            this.progressFlag = true;
            this.progressList = res.data.data;
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
            });
          }
        })
        .catch((err) => {
          this.hideLoading();
          this.$message({
            message: err,
            type: "error",
          });
        });
    },
    // 详情
    seeClick(row) {
      this.detailsFlag = true;
      this.detailsObj = row;
    },
    // seeClick(row) {
    //   this.showLoading();
    //   this.$axios({
    //     method: "get",
    //     url: `/labourMicro/queryMicroInfoById/${row.id}`,
    //     headers: {
    //       Authorization: this.requestToken,
    //     },
    //   })
    //     .then((res) => {
    //       this.hideLoading();
    //       if (res.data.code == "20000") {
    //         this.detailsFlag = true;
    //         this.detailsObj = res.data.data;
    //       } else {
    //         this.$message({
    //           message: res.data.message,
    //           type: "error",
    //         });
    //       }
    //     })
    //     .catch((err) => {
    //       this.hideLoading();
    //       this.$message({
    //         message: err,
    //         type: "error",
    //       });
    //     });
    // },
    // 详情关闭
    detailsClose() {
      this.detailsFlag = false;
    },
    // 修改
    editClick() {
      this.newaddFlag = true;
    },
    //图片上传
    handleAvatarSuccess(res, file) {
      this.imageUrl = URL.createObjectURL(file.raw);
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;

      if (!isJPG) {
        this.$message.error("上传图片只能是 JPG 格式!");
      }
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 2MB!");
      }
      return isJPG && isLt2M;
    },
    //查询企业数量
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    findClose() {
      this.findFlag = false;
    },
    newfindClose() {
      this.newfindFlag = false;
      this.findClose();
    },
    //产看企业介绍
    handleClick(row) {
      this.newfindFlag = true;
    },
  },
};
</script>
<style scoped>
.common-title-flex {
  display: flex;
}
.common-title-div {
  width: 3px;
  height: 16px;
  background-color: #368af7;
  margin-top: 2px;
}
.common-title-text {
  margin-left: 4px;
  font-size: 14px;
}
.common-list-class {
  display: flex;
  justify-content: space-between;
  margin-top: -10px;
}
.upload-file >>> .el-upload--text {
  border: none;
  width: 100px;
  height: 36px;
}
.el_card_class >>> .el-card__body {
  padding: 10px !important;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
</style>
